from flask_caching import Cache

cache: Cache = None


def setCache(app):
    global cache
    cache = Cache(app, config={'CACHE_TYPE': 'simple'})


def setValue(key: str, val: any, timeout=0):
    cache.set(key, val, timeout)


def delValue(key: str):
    cache.delete(key)
